/*
 * @Author: liangliang
 * @Date: 2023-05-22 18:47:50
 * @LastEditors: yusha
 * @LastEditTime: 2023-08-25 10:07:39
 * @Description: 新增/修改供应商信息
 */
import dayjs from 'dayjs';
import { Form, Input, InputNumber, Select, DatePicker } from 'antd';
import { useMount } from 'ahooks';
import './index.scss';

const EditDemoInfo = (props: any) => {
    const { formModal, rowItem } = props;
    const { modal, form } = formModal;

    useMount(() => {
        const { bugTime, ...rest } = rowItem;
        form.setFieldsValue({
            bugTime: dayjs(bugTime),
            ...rest,
        });
    });
    return (
        <>
            <Form name="editDemoInfo" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} form={form}>
                <div>
                    <Form.Item label="需求类型" name="demandType" rules={[{ required: true, message: '请选择' }]}>
                        <Select
                            placeholder="请选择"
                            options={[
                                { value: '1', label: '项目' },
                                { value: '2', label: '日常迭代' },
                                { value: '3', label: '快速需求' },
                                { value: '4', label: '技改' },
                                { value: '5', label: 'bugfix' },
                            ]}
                        />
                    </Form.Item>
                    <Form.Item label="需求状态" name="bugStatus" rules={[{ required: true, message: '请选择' }]}>
                        <Select
                            placeholder="请选择"
                            options={[
                                { value: '1', label: '需求中' },
                                { value: '2', label: '开发中' },
                                { value: '3', label: '测试中' },
                                { value: '4', label: '已发布' },
                                { value: '5', label: '已暂停' },
                            ]}
                        />
                    </Form.Item>
                    <Form.Item label="需求名称" name="demandName" rules={[{ required: true, message: '请输入' }]}>
                        <Input placeholder="请输入" />
                    </Form.Item>
                    <Form.Item label="PM" name="demandPm" rules={[{ required: true, message: '请输入' }]}>
                        <Input placeholder="请输入" />
                    </Form.Item>
                    <Form.Item label="PD" name="demandPd" rules={[{ required: true, message: '请输入' }]}>
                        <Input placeholder="请输入" />
                    </Form.Item>
                    <Form.Item label="UI" name="demandUi" rules={[{ required: true, message: '请输入' }]}>
                        <Input placeholder="请输入" />
                    </Form.Item>
                    <Form.Item label="后端开发" name="demandBackDevelop" rules={[{ required: true, message: '请输入' }]}>
                        <Input placeholder="请输入" />
                    </Form.Item>
                    <Form.Item label="前端开发" name="demandFrontDevelop" rules={[{ required: true, message: '请输入' }]}>
                        <Input placeholder="请输入" />
                    </Form.Item>
                    <Form.Item label="测试人员" name="demandTest" rules={[{ required: true, message: '请输入' }]}>
                        <Input placeholder="请输入" />
                    </Form.Item>
                    <Form.Item label="需求评审时间" name="businessAcceptanceDate" rules={[{ required: true }]}>
                        <DatePicker style={{ width: '100%' }} />
                    </Form.Item>
                    <Form.Item label="技术方案时间" name="technicalProposalDate" rules={[{ required: true }]}>
                        <DatePicker style={{ width: '100%' }} />
                    </Form.Item>
                    <Form.Item label="TC评审时间" name="demandReviewDate" rules={[{ required: true }]}>
                        <DatePicker style={{ width: '100%' }} />
                    </Form.Item>
                    <Form.Item label="联调时间" name="joinDebuggerDate" rules={[{ required: true }]}>
                        <DatePicker style={{ width: '100%' }} />
                    </Form.Item>
                    <Form.Item label="冒烟时间" name="managerAcceptanceDate" rules={[{ required: true }]}>
                        <DatePicker style={{ width: '100%' }} />
                    </Form.Item>
                    <Form.Item label="提测时间" name="submitApplicationDate" rules={[{ required: true }]}>
                        <DatePicker style={{ width: '100%' }} />
                    </Form.Item>
                    <Form.Item label="发布时间" name="publishDate" rules={[{ required: true }]}>
                        <DatePicker style={{ width: '100%' }} />
                    </Form.Item>
                    <Form.Item label="demo链接" name="yunxiaoLink" rules={[{ required: false, message: '请输入' }]}>
                        <Input placeholder="请输入" />
                    </Form.Item>
                    <Form.Item label="备注" name="remark">
                        <Input.TextArea rows={3} placeholder="请输入" />
                    </Form.Item>
                </div>
            </Form>
        </>
    );
};

export default EditDemoInfo;
